package com.cjhedu.web.service.impl;

import com.cjhedu.web.service.FileService;
import com.cjhedu.web.utils.MyAliYunOssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

/**
 * @author 陈佳豪
 * @version 1.0
 * 使用阿里云的方式实现本地啊上传
 */
@Service
@Primary
public class FileServiceImpl2 implements FileService {

@Autowired
private MyAliYunOssUtils myAliYunOssUtils;
    //本地储存文件
    @Override
    public String saveFile(MultipartFile file) throws IOException {
        String s = myAliYunOssUtils.uploadToOss(file);
        return s;
    }
}
